'use strict'
const path = require('path'); // 使用node.js中的path模块
const webpack = require('webpack')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.config')

module.exports = merge(baseWebpackConfig, {

    // cheap-module-eval-source-map is faster for development
    devtool: 'cheap-module-eval-source-map',

    // these devServer options should be customized in /config/index.js
    devServer: {
        contentBase: path.resolve(__dirname, 'dist'), // 配置开发服务运行时的文件根目录
        clientLogLevel: 'warning',
        hot: true,
        compress: true,
        host: 'localhost',
        port: 8080,
        open: true,
        overlay: true
    },
    plugins: [
        new webpack.HotModuleReplacementPlugin()
    ]
})